(define (union-set list1 list2)
  (let ((x (car list1))
        (y (car list2))))
  (cond ((null? list1) list2)
        ((null? list2) list1)
        ((< x y) (union-set (cdr list1) (cons x list2)))
        ((>= x y) (union-set (cdr list1) (cdr list2)))
        (else (union-set (cdr list1) list2))))
